/*
 * Filename:    WarnResultDAOImpl.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014年11月12日
 */
package com.paic.mhis.hcpms.warning.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.paic.mhis.hcpms.warning.dao.WarnResultDAO;
import com.paic.mhis.hcpms.warning.dto.WarnMonitorDTO;
import com.paic.mhis.hcpms.warning.dto.WarnResultDTO;
import com.paic.pafa.biz.dao.BaseDAO;

@Component("warnResultDao")
public class WarnResultDAOImpl extends BaseDAO implements WarnResultDAO {

	@Override
	public void addWarnResult(Map<String, Object> paramMap) {
		this._insert("warningResult", paramMap);
	}

	@Override
	public List<WarnMonitorDTO> findWarnMonitor() {
		return (List<WarnMonitorDTO>) this._list("warningMonitor", null);
	}

	@Override
	public List<WarnMonitorDTO> findWarnMonitorRule() {
		return (List<WarnMonitorDTO>) this._list("warningMonitorRule", null);
	}

	@Override
	public WarnResultDTO warningResultQuery(String warnNo) {
		List<WarnResultDTO> list = (List<WarnResultDTO>) this._list("warningResultQuery", warnNo);
		if (list.size() > 0)
			return list.get(0);
		else
			return null;
	}
}
